System and method for determining a cause of network congestion

ABSTRACT

A method and apparatus of a device that determines a cause and effect of congestion in this device is described. In an exemplary embodiment, the device measures a queue group occupancy of a queue group for a port in the device, where the queue group stores a plurality of packets to be communicated through that port. In addition, the device determines if the measurement indicates a potential congestion of the queue group, where the congestion prevents a packet from being communicated within a time period. If potential congestion exists on that queue group, the device further gathers information regarding packets to be transmitted through that port. For example, the device can gather statistics packets that are stored in the queue group and/or new enqueue packets.

RELATED APPLICATIONS

This application claims the benefit of prior, co-pending non-provisionalapplication Ser. No. 13/653,684, filed Jul. 29, 2013; which claims thebenefit of priority of prior, co-pending U.S. Provisional PatentApplication No. 61/784,574, filed Mar. 14, 2013, the entirety of whichis incorporated by reference.

FIELD OF INVENTION

This invention relates generally to data networking and moreparticularly to determining a cause and/or effect of congestion of portof a network element.

BACKGROUND OF THE INVENTION

A network element (such as a router or switch) transmits and receivesnetwork data using one or more ports of that network element. Each ofthese ports has a physical link speed that limits the rate at which thenetwork data can be transmitted from that port. The network element usesone or more queues to store the network data that is to be transmittedfrom one of the ports of the network element. The maximum data that aqueue stores is based on the available buffer memory and a bufferconfiguration for that queue.

A problem called congestion can occur for network data transmission bythe network element when the amount of network data that is to betransmitted by one of the ports is greater than the port and theassociated queue can handle. In particular, congestion for a port occurswhen network data cannot be transmitted through a port because the queuefor that port is full and impairs the enqueueing of subsequent data.When congestion happens on a port, a system administrator would like toknow the following information: (i) when did the congestion occur; (ii)what caused the congestion; and (iii) what is affected by thecongestion.

Currently, a network element determines that congestion has occurred bycounting the number of packets that have been dropped or marked as aresult of congestion. For example, the network element polls droppedpacket counters for each queue to determine the number of packetsdropped on that port. The number of dropped packets for a port over aperiod of time can be an indication that congestion occurred. However,the polling period can be too large to adequately determine the answersto the three questions above. For example, a network element can have apolling period of the dropped packet counters can be on the order oftens of seconds (e.g., 45 seconds). With this large polling time,detecting when congestion occurs can be tens of seconds in the past, andmake it difficult to determine what caused the congestion and also whatis affected by the congestion. In addition, microbursts of congestionmay not be detected if the burst does not cause congestion that resultsin dropped or marked packets. In addition, an administrator does nothave access to information that indicates which network element marked apacket as a result of congestion, when the packet was marked or droppeddue to congestion, or why a packet was marked or dropped due tocongestion.

SUMMARY OF THE DESCRIPTION

A method and apparatus of a device that determines a cause and effect ofcongestion in this device is described. In an exemplary embodiment, thedevice measures a queue group occupancy of a queue group for a port inthe device, where the queue group stores a plurality of packets to becommunicated through that port. In addition, the device determines ifthe measurement indicates a potential congestion of the port. If apotential for congestion exists on that port, the device further gathersinformation regarding packets to be transmitted through that port. Forexample, the device can gather statistics packets that are stored in thequeue group and/or statistics of new enqueue packets.

In a further embodiment, the device determines an effect of congestionin the device. The device measures a queue group occupancy of a queuegroup for a port in the device, where the queue group stores a pluralityof packets to be communicated through that port. The device furtherdetermines if congestion exists on that port using the measurement,where the congestion prevents a packet of the plurality of packets frombeing communicated using the port within a time period. If thecongestion exists on that port, the device additionally gathersinformation regarding packets to be transmitted through that port. Forexample, the device can gather statistics packets that are stored in thequeue group and/or statistics of new enqueue packets.

Other methods and apparatuses are also described.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and notlimitation in the figures of the accompanying drawings in which likereferences indicate similar elements.

FIG. 1 is a block diagram of one embodiment of a system that includes anetwork element communicating network data between a network and anumber of devices.

FIG. 2 is a block diagram of one embodiment of a system that includes anetwork element that communicates network data between a network and anumber of devices, where the network element includes a control planeand a data plane, and the data plane includes a number of queue groups.

FIG. 3 is a block diagram of one embodiment of a system that includes anetwork element that communicates network data between a network and anumber of devices, where the network element include a control plane anda data plane, and the data plane includes a number of queue groups andApplication-Specific Integrated Circuits (ASICs) used to record queuegroup occupancy in near-real-time.

FIG. 4 is an illustration of a queue group and the different monitoringthresholds for that queue group.

FIG. 5 is an illustration of a queue group occupancy vs. time curve,where this curve illustrates microbursts in the queue group occupancy.

FIG. 6A is a flow diagram of one embodiment of a process that monitors aqueue group occupancy of a port queue group and performs an action ifone of the thresholds is reached.

FIG. 6B is a flow diagram of one embodiment of a process that performsan action if one of the sample thresholds is reached.

FIG. 7 is a flow diagram of one embodiment of a process that determinesan effect of congestion.

FIG. 8 is a flow diagram of one embodiment of a process that determinesa cause of congestion.

FIG. 9A is a block diagram of a network congestion module that monitorsa queue group occupancy to determine a cause and/or effect ofcongestion.

FIG. 9B is a block diagram of a sample check module that checks for asample threshold action.

FIG. 10 is a block diagram of a network congestion module that monitorsa queue group occupancy of a port queue group and performs an action ifthe drop capture threshold is reached.

FIG. 11 is a block diagram of a network congestion module that monitorsa queue group occupancy of a port queue group and performs an action ifone of the congestion causation thresholds is reached.

FIG. 12 illustrates one example of a typical computer system, which maybe used in conjunction with the embodiments described herein.

FIG. 13 is a block diagram of one embodiment of an exemplary networkelement that that determines a cause and effect of congestion in thisnetwork element according to one embodiment of the system.

DETAILED DESCRIPTION

A method and apparatus of a device that determines a cause and effect ofcongestion in this device is described. In the following description,numerous specific details are set forth to provide thorough explanationof embodiments of the present invention. It will be apparent, however,to one skilled in the art, that embodiments of the present invention maybe practiced without these specific details. In other instances,well-known components, structures, and techniques have not been shown indetail in order not to obscure the understanding of this description.

Reference in the specification to “one embodiment” or “an embodiment”means that a particular feature, structure, or characteristic describedin connection with the embodiment can be included in at least oneembodiment of the invention. The appearances of the phrase “in oneembodiment” in various places in the specification do not necessarilyall refer to the same embodiment.

In the following description and claims, the terms “coupled” and“connected,” along with their derivatives, may be used. It should beunderstood that these terms are not intended as synonyms for each other.“Coupled” is used to indicate that two or more elements, which may ormay not be in direct physical or electrical contact with each other,co-operate or interact with each other. “Connected” is used to indicatethe establishment of communication between two or more elements that arecoupled with each other.

The processes depicted in the figures that follow, are performed byprocessing logic that comprises hardware (e.g., circuitry, dedicatedlogic, etc.), software (such as is run on a general-purpose computersystem or a dedicated machine), or a combination of both. Although theprocesses are described below in terms of some sequential operations, itshould be appreciated that some of the operations described may beperformed in different order. Moreover, some operations may be performedin parallel rather than sequentially.

The terms “server,” “client,” and “device” are intended to refergenerally to data processing systems rather than specifically to aparticular form factor for the server, client, and/or device.

A method and apparatus of a device that determines a cause and effect ofcongestion in this device is described. In one embodiment, the device isa network element that can communicate network data (e.g., data packetsor packets) with the one or more ports of the network element. Each ofthe ports of the network element has a corresponding queue group that isused to store the packets that are to be transmitted via that port. Thenetwork element periodically measures the queue group occupancy of thequeue group by reading a stored value of the queue group occupancy. Forexample, the network element stores the queue group occupancy of a queuegroup in an ASIC that is on the data plane of the network element. Anetwork congestion module of the network element retrieves the queuegroup occupancy value from the ASIC.

The network congestion module can perform one or more actions based ofthe queue group occupancy value. In one embodiment, the networkcongestion module uses different threshold to determine which action(s)to perform. The threshold can be a queue group occupancy trackingthreshold, a sample occupants threshold, a sample new enqueuesthreshold, and a drop capture threshold. In one embodiment, the queuegroup occupancy tracking threshold is a threshold at which the networkcongestion module starts recording the queue group occupancy over time.The network congestion module uses the queue group occupancy recordingto determine when to monitor the queue group occupancy prior to apotential congestion. In one embodiment, the sample occupants thresholdis a threshold of queue group occupancy that indicates that there ispotential congestion in the queue group. In one embodiment, the networkcongestion module can perform one or more of many different actions tocharacterize the packets that are queued in the queue group. In oneembodiment, the sample new enqueue threshold is another threshold basedon the queue group occupancy that indicates that there is potentialcongestion in the queue group. In one embodiment, the network congestionmodule can perform one or more of many different actions to characterizethe packets that are to be enqueued in the queue group. In oneembodiment, the drop capture threshold is a threshold that indicatesthat the queue group is fully occupied and that this queue group cannotstore any further packets at this time. In one embodiment, networkcongestion module can perform one or more of many different actions tocharacterize the queued packets affecting the congestion, characterizepackets to be enqueued that are affected by the congestion, and/oralleviate the actual congestion.

FIG. 1 is a block diagram of one embodiment of a system 100 thatincludes a network element 102 communicating network data between anetwork 108 and a number of devices 106A-C. In FIG. 1, the networkelement 102 is coupled to devices 106A-C and to network 108 via therespective links 110A-D. While in one embodiment, the respective links110A-D between the network element 102 and either the device 106A-Cand/or network 108 is a wired connection (e.g., copper, fiber, etc.), inalternate embodiments, a different type of link 110A-D is used (e.g.,wireless, a combination of wireless and wired, etc.). In one embodiment,each of these links 110A-D has a physical link speed that represents themaximum throughput of data that a link 110A-D can transmit in a timeperiod. In addition, the different types of protocols can be used tocommunicate network data over the connection (e.g., Ethernet, wireless,Synchronous Optical Networking (SONET), Fiber channel, Infiniband,etc.). In one embodiment, the network data being communicated by thenetwork element 102 is a stream of data packets. In one embodiment,network element 102 communicates network data between devices 104A-C andnetwork 108 or between devices 106A-C using a variety of communicatingtechniques (e.g., layer 2 switching, layer 3 routing, traffic shaping,applying a quality of service (QoS) policy, etc.).

In one embodiment, the network element 102 is a device that providesnetwork access to a network 108 (e.g., physical network, virtualizednetwork, etc.). A network element can be a switch, router, hub, bridge,gateway, etc., or any type of device that can provide access to anetwork. In one embodiment, the device 106A-C is any type of device thatcan communicate network data with another device (e.g., a personalcomputer, laptop, server, mobile device (e.g., phone, smartphone,personal gaming device, etc.), another network element, etc.). In oneembodiment, the devices 106A-C can be a virtual machine or can be adevice that hosts one or more virtual machines.

As described above, each of the links 110A-D has an associated physicallink speed, where each physical link speed represents a maximumthroughput for that link. In one embodiment, if the amount of networkdata is to be transmitted out one of the links 110A-D exceeds thephysical link speed of that link, the network data that exceeds thephysical link speed of that link is dropped and not transmitted out thelink. This can occur if network data from multiple downstream links aredestined for one link and/or if one of the links has a lower capacitythan the other links. For example and in one embodiment, link 110A is anupstream link that is coupled to the network 108 and provides access todevices 106A-C that are coupled to the network element 102 via links110B-D. In this example, devices 106A-C are transmitting network datathrough link 110A to network 108 at a rate that is greater than thephysical link speed of link 110A and network data (e.g., packets) isdropped because this network data cannot be communicated through link110A. Congestion for this link 110A occurs when network data cannot betransmitted through a port coupled to the link 110A because the queuegroup storing these packets is full and subsequent packets are droppedinstead of being transmitted through that port. In one embodiment, whencongestion happens on a port, a system administrator will want to knowthe following information: (i) when did the congestion occur, (ii) whatcaused the congestion; and (iii) what is affected by the congestion. Aswill be described in detail below, a queue group for a port is storagethat is used to store packets of the network data for processing and/orforwarding. In one embodiment, a queue group for a port can be a singlequeue, a class of queues, multiple queues, or a multiple classes ofqueues.

In one embodiment, the congestion can be determined by counting thenumber of packets that are dropped. In this embodiment, the networkelement polls dropped packet counters for each port to determine thenumber of packets dropped on that port. In this embodiment, the numberof dropped packets for a port over a period of time can be an indicationthat congestion has occurred. However, in this embodiment, the pollingperiod can be too large to adequately determine the answers to the threequestions above. For example and in one embodiment, a polling period ofthe dropped packet counters can be on the order of tens of seconds(e.g., 45 seconds). With this large polling time, detecting whencongestion occurs can be tens of seconds behind the actual congestionoccurrence, which can make it difficult to determine what caused thecongestion and also what is affected by the congestion. In addition,microbursts of congestion may not be detected if the microburst does notresult in dropped or marked packets. In one embodiment, a microburst isa period of congestion that is a short burst of network data thatcreates a short period of congestion on a port. In one embodiment, thelifetime of the microburst is smaller than the polling period of thedropped packet counters, which can make the microburst undetectableusing a polling method to detect congestion. In addition and in thisembodiment, the cause and effect of this congestion may not bedetectable as well. One way to alleviate this problem is to make thepolling periods smaller, where as the polling period get smaller, thecost to process the dropped packet data increases. Thus, it may not befeasible to decrease the polling period to catch occurrences ofmicroburst congestion. Furthermore, other measures of congestion can beused to characterize the congestion (e.g., queue depth (e.g., number ofbytes or packets in the queue), packet latency, number of buffers used,and/or number of buffer descriptors used).

FIG. 2 is a block diagram of one embodiment of a system 200 thatincludes a network element 202 that communicates network data between anetwork 208 and a number of devices 210A, where the network elementincludes a control plane 214 and a data plane 216, and the data plane216 includes a number of queue groups 218A-D. In FIG. 2, network element202 is coupled to the network 208 and devices 206A-D via links 210A-Dand ports 212A-D, respectively. While in one embodiment, the networkelement 202 is illustrated with four ports 212A-D and links 210A-D, inalternate embodiment, the network element 202 can have more or lesslinks and/or ports. In one embodiment, link 212A couples the networkelement 202 and the network 208 is an uplink link and has a smallerphysical link speed than the links 210B-C that couple the devices 206B-Dto the network element 202. For example and in one embodiment, port 212Aand link 210A have physical link speed of 10 gigabits/second (Gbps),whereas the downstream ports 212B-D and links 210B-D have a physicallink speed of 20 Gbps.

As described above, and in one embodiment, any one of the ports 212A-Dand associated links 210A-D can be overwhelmed with network data to thepoint that packets destined to be sent out the congested port aredropped or intolerably delayed instead of properly transmitted as aresult of congestion. For example and in one embodiment, device 206Acould transmit packets to network 208 at a rate greater than thephysical link speed of the port 212A and link 210A can handle (e.g.,greater than 10 Gbps). In this example, device 206A could cause thecongestion on port 212A because device 206A is transmitting at a rategreater than 10 Gbps and one effect of this congestion would be to droppackets coming from device 206A. In another example and anotherembodiment, device 206C may be transmitting packets to the network 208via port 212A and link 210A at a rate of 2 Gbps. Concurrently, device206B transmits data at a rate of 9 Gbps to network 208 via port 212A andlink 210A. Taken together, these data transmissions overwhelm the port212A and, thus, packets from either device 206B and 206C may be droppedor marked as a result of congestion. Thus, the network data from bothdevices 206B-C are affected by the congestion at port 212A. In thisexample, if the system administrator had sufficient information aboutthe traffic flow from devices 206B and 206C, the system administratormay determine that the cause of the is the network data from device 206Band the network data transmitted by devices 206B and 206C are affectedby the network congestion on port 212A.

In one embodiment, the network element 202 includes a control plane 214and data plane 216, where the control plane 214 controls and configuresthe forwarding decisions of the data plane 216 and the data plane 216receives the network data on the ports 212A-D and transmits this networkdata out a corresponding destination port 212A-D. To store the networkdata for transmission, the network element 202 uses the queue groups218A-D. In one embodiment, the data plane 216 stores the network data ina queue group 218A-D for the port 212A-D that is used for transmission.If there is no room in that queue group 218A-D to store a packet fortransmission, the data plane 216 drops the packet and increments acounter on the data plane 216 that tracks dropped packets for each queuegroup 218A-D. In one embodiment, the counters access 220 of the controlplane 214 allows access to the dropped packets counters of the networkelement (e.g., Simple Network Management Protocol (SNMP), command lineinterface (CLI), etc.).

In one embodiment, each queue group 218A-D is storage that is used tostore packets of the network data for processing and/or forwarding. Aqueue group can be used to store packets that have been received on aport, store packets that awaiting transmission, and/or store packetswaiting other processing (e.g., traffic shaping, applying QoS,forwarding decisions, security decisions, etc.). In one embodiment, eachof the illustrated queue groups 218A-D can represent a single queue,multiple queues, a class of queues, or multiple classes of queues. Inone embodiment, multiple different queues can be used for one port,where each individual queue can be used for the same or differentpurposes. For example and in one embodiment, multiple queues can be usedfor different QoS, traffic shaping, or other types of packetclassifications (e.g., a queue for best effort QoS, a queue for acertain bandwidth guarantee, etc.). In a further embodiment, anillustrated queue group 218A-D includes a class of queues for each ofthe other ports 212A-D. In this embodiment, each of the class of queuescan be one or more individual queues that are used to store packets fordifferent classifications for packets that are destined to betransmitted out the port 212A-D.

Congestion in a queue group can cause packets to not be transmitted atall or not in a timely fashion. In one embodiment, a queue groupcongestion can cause a stored packet or a new enqueue packet to not betransmitted. In another embodiment, a queue group congestion canintolerably delay the transmission or cause jitter of stored or newenqueue packets. Greater latency and jitter for packet transmission canbe a problem for certain applications that rely on low network latencyand jitter and desire greater deterministic network performance (e.g.,financial trading applications, media applications, audio/videoapplications, telephony applications, fire control, target telemetry,high performance computing, market data distribution, etc.).

In one embodiment, the control plane includes counters access 220,polling module 222, and storage 224. In one embodiment, the pollingmodule 222 periodically polls the counters on the data plane 216 fordropped packets on each queue group 218A-D. As described above, thepolling period of the polling module 222 can be on the order of tens ofseconds, which can cause problems in determining when congestion on aport occurs, what caused this congestion, and what is affected by thecongestion. The counters access 220 allows access to the dropped packetscounters of the network element (e.g., SNMP, CLI, etc.). In oneembodiment, the storage 224 is used to store results of polling module222 and other information.

As described above, a counter polling method of detecting and detailingcongestion has problems because the counter polling method can havesignificant lag in determining when the congestion is discovered and maynot be able to adequately characterize the congestion. A way to overcomethis problem is to monitor the occupancy of the queue groups in nearreal-time (e.g., within 800 microseconds) and collect information(and/or perform other actions) to determine the cause and effect of thecongestion. FIG. 3 is a block diagram of one embodiment of a system 300that includes a network element 302 that communicates network databetween a network 308 and a number of devices 306A-C, where the networkelement 302 include a control plane 314 and a data plane 316 and thedata plane 316, includes a number of ASICs 326A-D that are used torecord queue group occupancy in near-real-time.

In one embodiment, queue group occupancy is a measure how many networkelement resources the queue group is using. Queue group occupancy can bemeasured using one or more different metrics, such as queue group depth,packet latency, number of buffers used, and/or number of bufferdescriptors used. In one embodiment, the queue group depth is the numberof bytes or packets that are in the queue group. This queue group depthcan be a measure for an individual queue, or an aggregate of multiplequeues.

In one embodiment, packet latency is the time from when the first bit ofa packet hits the ingress port's transceiver to when the first bit hitsthe egress port's cable. In this embodiment, this type of packet latencycan be called “first bit in to first bit out” latency. In oneembodiment, first bit in to first bit out latency can be measuredindirectly, for example, by setting up a packet loop and counting howmany times the packet makes it around the loop in a period of time(e.g., 30 seconds). In this embodiment, the packet latency would be theperiod of time divided by counter value.

In another embodiment, packet latency can be estimated by measuring thequeuing delay component of the packet latency, which is the amount oftime the packet descriptor spends waiting in a queue for the egress portto be available. In one embodiment, this component is called “queuingdelay.” In one embodiment, the queuing delay contributes to the packetlatency. Furthermore, in a congested network, the queuing delay can bethe dominant component of the packet latency. In one embodiment, queuingdelay is measured by timestamping the descriptor as the packet is placedin the queue, and subtracting this timestamp from the dequeue time ofthe packet.

In a further embodiment, the network element 302 can use a test packetor a “token” to measure packet latency. In this embodiment, the networkelement 302 inserts a special token is into the queue and records thetime the token was inserted. When the token reaches the head of thequeue, the network element 302 subtracts this time from the insertiontime to determine the queuing delay for the token. In this embodiment,it may be that no actual packet experiences precisely that delay, butpackets enqueued just before or just after the token probably experiencelatencies close to the token's latency. In one embodiment, this iscalled a “token delay” latency measure.

In one embodiment, the network element 302 tracks the depths (or sizes)of the queues. In one embodiment, the depth is measured in “buffers”,where a buffer is an allocation unit within the ASIC. In one embodiment,the buffer can range from 50 to 500 bytes. As described above, thenetwork element 302 can send notifications when the queue depth crossesa threshold. In one embodiment, while the queue depth is not really thesame thing as queue or packet latency, a deeper queue does tend toresult in more latency, so there is value in giving the customervisibility into queue depth. However, there are several factorsweakening the relationship between latency and queue depth. For exampleand in one embodiment, lower-priority traffic has to wait forhigher-priority traffic and thus might experience a larger delay even ifall queues are small (assuming a continuous stream of high-prioritytraffic). As another example, flow control (e.g., 802.3x PAUSE) canprevent any transmission out a port, leading to large delays even withsmall queues. Finally, there is the issue of the actual occupancy of thebuffers in the queue. For a queue with small sized buffers, a 64-bytepacket introduces less latency for later packets than a 450-byte packetdoes. However, for a queue with 500-byte buffers, both get counted asone buffer.

In one embodiment, the number of buffers used is the number of buffersthat are being used by the queue group 318A-D. In one embodiment, eachqueue group 318A-D allocates one or more buffers to store the packets.As with queue group depth, the number of buffers used can be for onequeue group or for multiple queue groups. In one embodiment, the numberof buffer descriptors is used represents another measure of how thenetwork element 302 resources are being used and can be used for onequeue group or for multiple queue groups.

While in one embodiment, the network element 302 is illustrated withfour ports 312A-D and links 310A-D, in alternate embodiment, the networkelement 302 can have more or less links and/or ports. Similar to FIG. 2,network element 302 is coupled to the network 308 and devices 306A-D vialinks 310A-D and ports 312A-D, respectively. In one embodiment, link312A, which couples the network element 302 and the network 308 is anuplink and have a smaller physical link speed than the links 312B-C thatcouple the devices 306B-D to the network element 302. For example and inone embodiment, port 312A and link 310A have physical link speed of 10gigabits/second (Gbps), whereas the downstream ports 312B-D and links310B-D have a physical link speed of 20 Gbps.

In one embodiment, the control plane 314 includes counters access 320,polling module 322, and storage 324. In one embodiment, the pollingmodule 322 periodically polls the counters on the data plane 316 fordropped packets on each queue group 318A-D. As described above, thepolling period of the polling module 322 can be on the order of tens ofseconds, which can cause problems in determining when congestion on aport occurs, what caused this congestion, and what is affected by thecongestion. The counters access 320 allows access to the dropped packetscounters of the network element (e.g., SNMP, CLI, etc.). In oneembodiment, the storage 324 is used to store results of polling module322 and other information.

In addition, the network element 302 includes a control plane 314 anddata plane 316, where the control plane 314 controls and configures theforwarding decisions of the data plane 316 and the data plane 316receives the network data on the ports 312A-D and transmits this networkdata out a corresponding destination port 312A-D. The control planeincludes counters access 320, polling module 322, and storage 324. Thedata plane includes queue groups 318A-D, ASICs 326A-D, and networkcongestion module 328. In one embodiment, the queue groups 318A-D storethe network data for transmission for a corresponding port 312A-D.

In one embodiment, any one of the ports 312A-D and associated links310A-D can be overwhelmed with network data to the point that packetsdestined to be sent out the congested port are dropped instead oftransmitted. To detect the occupancy of the queue groups 318A-D in nearreal-time (e.g., within 800 microseconds), the data plans uses the ASICs326A-D to store what the current queue group occupancy is for each queuegroup 318A-D. Thus, in near real-time, the queue group occupancy isknown to the data plane 316. Consequently, by knowing the queue groupoccupancy in near real-time, the network element 302 can take actions todetermine when congestion occurs for a port, what caused the congestionof the port, and/or what is the effect of the congestion of that port.

In one embodiment, the network congestion module 328 monitors the queuegroup occupancy stored in the ASICs 326A-D and performs actions based onthe level of queue group occupancy in the queue group 318A-D. Bymeasuring the queue group occupancy, in near real-time, a systemadministrator can have an idea when the congestion is about or hasoccurred. In one embodiment, the network congestion module 328 performsdifferent actions based on different thresholds of queue groupoccupancy. In this embodiment, there are four different thresholds: aqueue group occupancy tracking threshold; a sample occupants threshold;a sample new enqueue threshold; and a drop capture threshold. In oneembodiment, the queue group occupancy tracking threshold is the lowestof the thresholds (e.g., lowest queue group occupancy), the sampleoccupants and sample new enqueue thresholds are the middle levelthresholds, and the drop capture threshold is the highest levelthreshold. In one embodiment, if the queue group occupancy of a queuegroup 318A-D is greater than the queue group occupancy trackingthreshold, the network congestion module 328 starts recording the queuegroup occupancy. This threshold is used to determine when to monitor thequeue group occupancy prior to a potential congestion. In anotherembodiment, if the queue group occupancy of a queue group 318A-D isgreater than the sample occupants threshold, the network congestionmodule 328 performs an action to collect information about the occupantsof the this queue group 318A-D that can assist a system administratordetermine what is a cause of a potential congestion on a port. Inanother embodiment, if the queue group occupancy of a queue group 318A-Dis greater than the sample new enqueue threshold, the network congestionmodule 328 performs an action to collect information about new enqueuepackets for the queue group that can assist a system administratordetermine what is a cause of a potential congestion on a port. In afurther embodiment, if the queue group occupancy of a queue group 318A-Dis greater than the drop capture threshold, the network congestionmodule 328 performs an action to collect information that can assist asystem administrator determine what is an effect of a congestion on aqueue group 318A-D and/or alleviate the congestion for the queue group318A-D. The different thresholds are described further below.

FIG. 4 is an illustration of a queue group 400 and different monitoringthresholds 402A-D for that queue group 400. In one embodiment, a queuegroup 400 is storage that the network element uses to store packets fortransmission. As described above, a queue group for a port can be anindividual queue, multiple queues, a class of queues, or multipleclasses of queues. Each individual queue can be a first-in, first-outqueue, last in, first out queue, strict priority queue, egress queue, oranother type of queue used for a port.

In one embodiment, a queue group occupancy of a queue group representsthe amount of the queue group resources that are being used to storepackets awaiting transmission. Queue group occupancy can be measuredusing one or more different metrics, such as queue group depth, packetlatency, number of buffers used, and/or number of buffer descriptorsused. If the network element stores a packet in the queue group, thequeue group occupancy increases, whereas if a packet is de-queued fromthe queue group for transmission, the queue group occupancy decreases.In one embodiment, the network element stores the current queue groupoccupancy of a queue group in an ASIC in near real-time (e.g., within adelay of within 800 microseconds).

In one embodiment, there are four different thresholds 402A-D: a queuegroup occupancy tracking threshold 402A; a sample new occupantsthreshold 402B; a sample new enqueue threshold 402C; and a drop capturethreshold 402D. In one embodiment, the queue group occupancy trackingthreshold 402A is the lowest of the thresholds (e.g., lowest queue groupoccupancy), the sample new enqueues threshold 402C and the sample newenqueue threshold 402C are the middle level thresholds, and the dropcapture threshold 402D is the highest level threshold. While in oneembodiment, the order of the thresholds is (from lowest to highest) thequeue group occupancy tracking threshold 402A, a sample new occupantsthreshold 402B, a sample new enqueue threshold 402C, and a drop capturethreshold 402D, in alternate embodiments, the order of the threshold canbe different and/or two or more of the thresholds may have the samevalue.

In one embodiment, the queue group occupancy can be a function of one ormore different queue group resource metrics (e.g., queue depth, packetlatency, number of buffers used, and/or number of buffer descriptorsused). Each of these thresholds can be set for a particular value of thequeue group occupancy. In one embodiment, if the queue group occupancyof a queue group is greater than the queue group occupancy trackingthreshold 402A, the network congestion module 328 starts recording thequeue group occupancy. By recording this queue group occupancy, thenetwork congestion module 328 can record how the queue group 400 isutilized over time. In one embodiment, the recording of the queue groupoccupancy via the ASIC is performed with a periodicity that is smallerthan the periodicity used by the control plane to poll the droppedcounters. For example and in one embodiment, the periodicity is on theorder of less than a millisecond (e.g., 800 microseconds) for the queuegroup occupancy recordation. In contrast, the recording of the droppedpacket counters in on the order of tens of seconds. In one embodiment,by recording the queue group occupancy at this fine-grained level, thenetwork congestion module 328 can detect the presence of microburststhat does not cause dropped or marked packets due to congestion. In thisembodiment, a microburst for a port is a short burst of packets to betransmitted through one port. The microburst can cause congestion or themicroburst data can be less than the physical link speed capacity of theport. In addition, the microburst can also interfere with other networkdata being transmitted out the port from other devices. In oneembodiment, the burst time of a microburst can be of a short duration(e.g., less than one second). Using the fine-grained recordation of thequeue group occupancy value allows for detect of a short duration burstof a microburst. Microbursts are further described in FIG. 5 below. Inone embodiment, the queue occupancy tracking threshold 402A is used todetermine when to monitor the queue group occupancy prior to a potentialcongestion. In one embodiment, if the queue group occupancy falls belowthe queue group occupancy tracking threshold 402A, the networkcongestion module 328 turns off the recording of the queue groupoccupancy. In one embodiment, the queue group occupancy trackingthreshold 402A can be a threshold that is a threshold that is based onone of the metrics for the queue group occupancy (e.g., queue depth,packet latency, etc.) or can be a combination of two or more of thequeue group occupancy metrics (e.g., queue depth and packet latency). Inone embodiment, the queue group occupancy tracking threshold 402A for aqueue group 400 is a queue group occupancy of less than 50% of the queuedepth (e.g., 20% or 25%).

In one embodiment, once the queue group occupancy of the queue group 400reaches the sample occupants threshold 402B, the network congestionmodule 328 can perform one or more of many different actions tocharacterize the packets stored in the queue group, and/or send anotification. In one embodiment, the network congestion module 328gathers statistics about the packets occupying the queue group. Forexample and in one embodiment, the network congestion module 328 recordsthe source address, packet type, other statistics (payloadcharacteristics, destination address, etc.) for the stored packets,and/or a combination therein. In this example, the statistics regardingthe stored packets can give the system administrator of the type ofpackets that is causing this queue group occupancy. In anotherembodiment, the network congestion module 328 can perform these actionson some or all of the packets in the queue group. For example and in oneembodiment, the network congestion module 328 can gather statisticsregarding packets that have a high priority and ignore other packetsthat have a lower priority. Alternatively, the network congestion module328 can gather grater statistics regarding higher priority packets(e.g., address and packet type information) and less statistics forlower priority packets (e.g., packet counts). In one embodiment, thenetwork congestion module 328 stores the gathered statistics in thestorage 324. In a further embodiment, the network congestion module 328copies some or all of the stored packets to the storage 324. In thisembodiment, the network congestion module 328 creates a packet capturefile that captures the packet information.

In a further embodiment, the network congestion module 328 sends anotification to the system administrator that the sample occupantsthreshold 402B has been reached for this queue group 400. In oneembodiment, the notification includes information characterizing thetype of data being stored (e.g., send a notification with a packetcapture of the stored packets, statistics, and/or other type ofinformation). In one embodiment, the notification can be an email, text,automated voice call, tweet, and/or any other type of notification. Inone embodiment, once the queue group occupancy of queue group 400 fallsbelow the sample occupants threshold 402B, the network congestion module328 cancels the action that was setup in response to the queue groupoccupancy crossing the sample occupants threshold 402B.

In one embodiment, once the queue group occupancy of the queue group 400reaches the sample new enqueues threshold 402C, the network congestionmodule 328 can perform one or more of many different actions tocharacterize the packets that are to be enqueued in the queue group. Inone embodiment, the network congestion module 328 gathers statisticsabout the new enqueue packet. For example and in one embodiment, thenetwork congestion module 328 records the source address, packet type,and/or other statistics (payload characteristics, destination address,etc.) for the new enqueue packets. In this example, the statisticsregarding the new enqueue packets can give the system administrator anindication of the type of packets that is causing this level of queuegroup occupancy. In another embodiment, the network congestion module328 can perform these actions of some or all of the new enqueue packets.For example and in one embodiment, the network congestion module 328 cangather statistics regarding packets that have a high priority and ignoreother packets that have a lower priority. Alternatively, the networkcongestion module 328 can gather more statistics regarding higherpriority packets (e.g., address and packet type information) and lessstatistics for lower priority packets (e.g., packet counts). In oneembodiment, the network congestion module 328 stores the gatheredstatistics for the enqueued packets in the storage 324. In a furtherembodiment, the network congestion module 328 copies some or all of thestored packets to the storage 324. In this embodiment, the networkcongestion module 328 creates a packet capture file that captures thepacket information. In a further embodiment, the network congestionmodule 328 sends a notification to the system administrator that thesample new enqueues threshold 402C has been reached for this queue group400. In one embodiment, the notification includes informationcharacterizing the type of data being stored (e.g., send a notificationwith a packet capture of the stored packets, statistics, and/or othertype of information). In one embodiment, the notification can be anemail, text, automated voice call, tweet, and/or any other type ofnotification. In one embodiment, once the queue group occupancy of queuegroup 400 falls below the sample new enqueues threshold 402C, thenetwork congestion module 328 cancels the action that was setup inresponse to the queue group occupancy crossing the sample new enqueuesthreshold 402C.

In a further embodiment, if the queue group occupancy of a queue group400 is equal to or greater than the drop capture threshold 402D, thenetwork congestion module 328 performs one or more actions to alleviatethe congestion and/or collect information that can assist a systemadministrator determine what is an effect of a congestion on a port. Inone embodiment, the drop capture threshold 402D is a threshold that is athreshold that is based on one of the metrics for the queue groupoccupancy (e.g., queue depth, packet latency, etc.) or can be acombination of two or more of the queue group occupancy metrics (e.g.,packet latency and number of buffers used). In one embodiment, the dropcapture threshold 402D is 100% queue group occupancy or below 100% queuegroup occupancy, where the queue group 400 is in a condition that thequeue group 400 cannot store another packet. In another embodiment, thedrop capture threshold 402D is a threshold that is configured to be at apoint of the queue occupancy in which the administrator feels thatcongestion has occurred (e.g., if the queue latency is greater than aparticular time limit).

In one embodiment, the network congestion module 328 can drop theenqueued new packets, drop the stored packets, do a packet capture ofthe new enqueue packets, do a packet capture of the stored packets,and/or perform another action. For example and in one embodiment, thenetwork congestion module 328 drops some or all of the stored packetsfor this queue group. By dropping the packets in the queue group, newenqueue packets can be stored in the queue group for transmissioninstead of dropping these packets. In one embodiment, the networkcongestion module 328 drops lower priority packets and leaves the higherpriority packets in the queue group. In this embodiment, the networkcongestion module 328 can selectively drop the packets based on acharacteristic of the stored packets. In a further example and in oneembodiment, the network congestion module 328 drops some or all of thenew enqueue packets for this queue group. By dropping the new enqueuepackets for this queue group, subsequent packets can be stored in thequeue group for transmission instead of being dropped. In oneembodiment, the network congestion module 328 drops lower priority newenqueue packets and leaves the higher priority new enqueue packets inthe queue group. In this embodiment, the network congestion module 328can selectively drop the new enqueue packets based on a characteristicof these packets.

In another embodiment, the network congestion module 328 performs apacket capture of the stored and/or new enqueued packets. In thisembodiment, the network congestion module 328 snapshots the queue groupfor a period, save to persistent storage (e.g., storage 324 of FIG. 3above), and tag this snapshot with the device name and port identifierof where the congestion even occurred. In one embodiment, the networkcongestion module 328 subsamples this snapshot that allows a systemadministrator to get an indication of the stored and/or new enqueuepackets. In another example and embodiment, network congestion module328 can create a real-time micro Transmission Control Protocol (TCP)dump snapshot that gives a 1:1 packet view into what is going into thebuffer while the buffer was congested. In one embodiment, the microdumpsnapshot may be a smaller snapshot than the buffer snapshot above, butwould allow for greater depth of information.

In one embodiment, the information collected (e.g., the packet capture)is for the effect of the congestion, instead of the information that mayindicate the cause of the congestion. In a further embodiment, thenetwork congestion module 328 copies some or all of the stored packetsto the storage 324. In this embodiment, the network congestion module328 creates a packet capture file that captures the packet information.

In an alternate embodiment, the network congestion module 328 canalleviate the congested queue group occupancy by sending the storedpackets and/or new enqueue packets out a different port. In thisembodiment, the network congestion module 328 forwards packets that arestored from queue group 400 to another port that has a lowerutilization. For example and in one embodiment, the network congestionmodule 328 can forward the stored packets out another port that allowsthe stored packets to arrive at the packet destination. In anotherembodiment, the network congestion module 328 can forward new enqueuepackets out another port. In a further embodiment, the networkcongestion module 328 sends a notification to the system administratorthat the drop capture threshold 402D has been reached for this queuegroup 400. In one embodiment, the notification includes informationcharacterizing the type of data being stored (e.g., send a notificationwith a packet capture of the stored packets, statistics, etc.). In oneembodiment, the notification can be an email, text, automated voicecall, tweet, and/or any other type of notification. In one embodiment,once the queue group occupancy falls below the drop capture threshold402D, the network congestion module 328 cancels the action that wassetup in response to the queue group occupancy crossing the drop capturethreshold 402D and reverts to the actions performed in response to thequeue group occupancy being above the congestion causation threshold402B.

As described above, the network congestion module 328 can use one ormore of the four thresholds 402A-D to characterize the network data thatis being utilized by the queue group 402. In one embodiment, anadministrator can configure these thresholds, so that the actionsperformed in response the threshold being met can characterize the causeand/or effect of the congestion, as well as alleviate the congestion innear-real time. In one embodiment, the network congestion module 328 canuse one, some, or all of the four thresholds (queue group occupancytracking threshold, sample occupants threshold, sample new enqueuesthreshold, and drop capture threshold) to characterize the queue groupoccupancy of the queue group. For example and in one embodiment, thenetwork congestion module 328 can use one or more of the thresholds,such as the drop capture threshold, to determine an effect of congestionof a queue group. In this embodiment, if the queue group occupancy is ata point of congestion, the actions performed in response to the queuegroup occupancy above this level will give an indication of the effectof the congestion and/or alleviate the effect of the congestion. Forexample and in one embodiment, if congestion is indicted as a queuedepth at 100%, an administrator may configure the drop packet thresholdfor 100% queue depth, sample new enqueues at 85% queue depth, sample newoccupants at 80% queue depth, and queue occupancy tracking threshold at25% queue depth. In this example, if the queue occupancy reaches at 100%queue depth, the actions performed in response to the queue depth willgive an indication of the effect of the congestion. In addition, actionsmay be performed to alleviate this congestion (e.g. dropping storedand/or new enqueue packets, changing the destination port for storedand/or new enqueue packets, etc.).

In another embodiment, the network congestion module 328 can use anotherone or more of the thresholds, such as the either sample thresholdand/or the queue occupancy tracking threshold, to determine a causationof the congestion. In this embodiment, if the queue group occupancyapproaching a point of congestion, the actions performed in response tothe queue group occupancy above this level will give an indication of acause of the congestion. In one embodiment, the thresholds can be one ormore of the queue occupancy tracking threshold, sample occupantsthreshold, sample new enqueues threshold, and drop capture threshold. Inthis embodiment, each of these thresholds can trigger different actionsin response to a queue occupancy approaching a congestion of that queuegroup. For example and in one embodiment, if congestion is indicted as aqueue depth at 100%, an administrator may configure the sample newenqueues at 85% queue depth, sample new occupants at 80% queue depth,and queue occupancy tracking threshold at 25% queue depth. In thisexample, if the queue occupancy reaches at 80 or 85% queue depth, theactions performed in response to the queue depth will give an indicationof the effect of the congestion. In addition, if the drop capturethreshold is set to this level, actions may be performed to alleviatethis congestion (e.g. dropping stored and/or new enqueue packets,changing the destination port for stored and/or new enqueue packets,etc.).

FIG. 5 is an illustration of queue group occupancy vs. time curve 506,where this curve 506 illustrates microbursts 508 in the queue groupoccupancy. In FIG. 5, the queue group occupancy vs. time curve 506 is acurve that plots the queue group occupancy 502 over time 504. In oneembodiment, the curve 506 represents a fine-grained view of how a queuegroup is used over time. For example and in one embodiment, the queuegroup occupancy is sampled on a period of less than one millisecond(e.g., a period of 800 microseconds). Because of the small samplingperiod, the curve 506 illustrates microbursts. As described above, amicroburst 506 is a period of congestion that is a short burst ofnetwork data that creates a short period of congestion on a port. In oneembodiment, the width of microburst is smaller than the polling periodof the dropped packet counters, which can makes the microburstundetectable using a polling method to detect congestion. In oneembodiment, a microburst can congest a queue group, and causing adropping of subsequent packets that are to be transmitted out the portcorresponding to the congested port.

FIG. 6A is a flow diagram of one embodiment of a process 600 thatmonitors a queue group occupancy of a port queue group and performs anaction if one of the thresholds is reached. In one embodiment, a networkcongestion module performs process 600 to monitor a queue groupoccupancy and perform one or more actions if one of the thresholds isreached, such as the network congestion module 328 of the networkelement 302 as described in FIG. 3 above. In FIG. 600, process 600begins by measuring a queue group occupancy of the queue group thatholds the network data to be transmitted at block 602. In oneembodiment, process 600 measures the queue group occupancy by retrievingthe queue group occupancy value from an ASIC on the data plane of thenetwork element. In this embodiment, the current queue group occupancyis periodically stored in the ASIC and process 600 retrieves the storedvalue. For example and in one embodiment, storing the queue occupancy isdescribed in U.S. patent application Ser. No. 13/420,527, entitled“Latency Analysis of Traffic Passing Through an Ethernet Switch”, filedon Mar. 14, 2012 and incorporated by reference.

At block 604, process 600 determines if the queue group occupancy isgreater than or equal to a drop capture threshold. In one embodiment,the drop capture threshold is a threshold that indicates that the queuegroup is fully occupied and that this queue group cannot store anyfurther packets at this time. In one embodiment, the drop capturethreshold is at 100% queue group occupancy or below 100% queue groupoccupancy, where the queue group is in a condition that the queue groupcannot or should not store another packet (e.g., queue latency is toogreat). If the queue group occupancy is not greater than the congestioncausation threshold, execution proceeds to block 608 below.

If the queue group occupancy is greater than or equal to the dropcapture threshold, at block 606, process 600 performs one or moreactions. For example and in one embodiment, process 600 can drop theenqueued new packets, drop the stored packets, do a packet capture ofthe new enqueue packets, do a packet capture of the stored packets,and/or perform another action as described in FIG. 4 above. In a furtherembodiment, process 600 copies some or all of the stored packets to thestorage. In this embodiment, process 600 creates a packet capture filethat captures the packet information.

In a further alternate embodiment, process 600 can alleviate thecongested queue group occupancy by sending the stored packets and/or newenqueue packets out a different port. In this embodiment, process 600forwards packets that are stored from queue group to another port thathas a lower occupancy. For example and in one embodiment, process 600can forward the stored packets out another port that allows the storedpackets to arrive at the packet destination. In another embodiment,process 600 can forward new enqueue packets out another port. In analternate embodiment, process 600 can drop one, some, or all of thestored packets, so as to make room for other packets that are to bestored in the queue group. For example and in one embodiment, process600 can drop lower priority stored packets from a lower priority queueinstead of high priority packets. In a further embodiment, process 600sends a notification to the system administrator that the drop capturethreshold has been reached for this queue group. In one embodiment, thenotification includes information characterizing the type of data beingstored (e.g., send a notification with a packet capture of the storedpackets, statistics, etc.). In one embodiment, the notification can bean email, text, automated voice call, tweet, and/or any other type ofnotification.

As an example and in another embodiment, a trading server is coupled tothe network element and the trading server is receiving data and makingfinancial trades with a financial exchange based on the received data.In this embodiment, the trading server sends the financial traderequests via a port of the network element that is congested. Thenetwork element detects this congestion of the port by measuring thequeue group occupancy of the queue group for that port. In addition,instead of forwarding the packets from the trading server via thecongested port, the network element forwards these packets out anotherport. In one embodiment, the network element forwards these packets viaa port that can reach the current financial exchange. In anotherembodiment, the network element forwards these packets out another portto a different financial exchange to make the financial trades.

If the queue group occupancy is less than the drop capture threshold, atblock 608, process 600 checks drop capture threshold action cancelation.In one embodiment, process 600 determines if actions were setup inresponse to the queue group occupancy crossing the drop capturethreshold. If an action was setup, process 600 cancels this actionbecause the queue group occupancy of this queue group is below the dropcapture threshold. For example and in one embodiment, if process 600previously setup a packet capture of stored packet in response to thequeue group occupancy crossing the drop capture threshold and thecurrent queue group occupancy is less than the drop capture threshold,process 600 cancels this packet capture.

At block 610, process 600 checks for a sample threshold action. In oneembodiment, a sample threshold in either the sample occupants or samplenew enqueues threshold as described in FIG. 4 above. Process 600 checksif one of the sample thresholds is achieved, and performs or cancels anaction if one of the thresholds were crossed. Checking for a samplethreshold is further described in FIG. 6B below.

At block 612, process 600 determines if the queue group occupancy isgreater than or equal to a queue group occupancy tracking threshold. Inone embodiment, the queue group occupancy tracking threshold is athreshold at which process 600 starts recording the queue groupoccupancy and is used to determine when to monitor the queue groupoccupancy prior to a potential congestion. In addition, the queue groupoccupancy tracking threshold is used by process 600 to record the queuegroup occupancy. In one embodiment, the queue group occupancy trackingthreshold is less than 50% (e.g., 20% or 25% of a queue depth, smallqueue latency, etc.). If the queue group occupancy is greater than thequeue group occupancy tracking threshold, at block 614, process 600periodically records the current queue group occupancy. In oneembodiment, process 600 records the current queue group occupancy innear real-time (e.g. every 800 microseconds). Execution proceeds toblock 602 above. If the queue group occupancy is not above the queuegroup occupancy tracking threshold, at block 620, process 600 checks fora queue group occupancy tracking threshold action cancelation. In oneembodiment, process 600 determines if a recording of the queue groupoccupancy was setup in response to a previous to the queue groupoccupancy crossing the queue group occupancy tracking threshold. Ifqueue group occupancy recording was setup, process 600 cancels thisaction because the queue group occupancy of this queue group iscurrently below the queue group occupancy tracking threshold. Executionproceeds to block 602 above.

FIG. 6B is a flow diagram of one embodiment of a process 650 thatperforms an action if one of the sample thresholds is reached. In oneembodiment, process 650 is performed by process 600 at block 610 of FIG.6A above to check for sample threshold actions. In one embodiment, thesample action thresholds are the sample occupants and the same newenqueue packets thresholds as described above in FIG. 4. In oneembodiment, either of these thresholds can be configured to be close tofull occupancy (e.g., 80% or greater). Once the queue group occupancyhits either of these thresholds at this configuration, if the queuegroup occupancy continues to increase, the queue group and associatedport will be congested. Thus, this threshold may serve as a warning thatcongestion may occur for this queue group. In addition, the network datafilling this queue group may be an indication of the potentialcongestion.

In FIG. 6B, process 650 begins by checking if the queue group occupancyis equal to or greater than the sample occupants threshold at block 652.If the queue group occupancy is greater than or equal to the sampleoccupants threshold, at block 654, process 650 performs one or moreactions than can be performed for this threshold. For example and in oneembodiment, process 652 can perform one or more of many differentactions to characterize the packets occupying in the queue group, and/orsend a notification as described above in FIG. 4. Execution proceeds toblock 656 below. If the queue group occupancy a below the sampleoccupants threshold, execution proceeds to block 656 below. At block656, process 650 checks for sample occupants threshold actioncancelation. In one embodiment, process 650 determines if actions weresetup in response to a previous to the queue group occupancy crossingthe sample occupants threshold (e.g., gathering statistics about storedpackets, or other actions described above, etc.). If an action wassetup, process 650 cancels this action because the queue group occupancyof this queue group is below the sample occupants threshold. For exampleand in one embodiment, if process 650 previously setup a gathering ofstatistics in response to the queue group occupancy crossing the sampleoccupants threshold and the current queue group occupancy is less thanthe sample occupants threshold, process 650 cancels the gathering of thestatistics.

At block 658, process 650 checks if the queue group occupancy is equalto or greater than the sample new enqueues threshold. If the queue groupoccupancy is greater than or equal to the sample new enqueues threshold,at block 660, process 650 performs one or more actions than can beperformed for this threshold. For example and in one embodiment, process652 can perform one or more of many different actions to characterizethe packets that will be enqueued in this queue group, and/or send anotification as described above in FIG. 4. Execution proceeds to block662 below. If the queue group occupancy falls below the sample newenqueues threshold, execution proceeds to block 662 below. At block 662,process 650 checks for sample new enqueues threshold action cancelation.In one embodiment, process 650 determines if actions were setup inresponse to a previous to the queue group occupancy crossing the samplenew enqueues threshold (e.g., gathering statistics about stored packets,or other actions described above, etc.). If an action was setup, process650 cancels this action because the queue group occupancy of this queuegroup is below the sample new enqueues threshold. For example and in oneembodiment, if process 650 previously setup a gathering of new enqueuestatistics in response to the queue group occupancy crossing the samplenew enqueues threshold and the current queue group occupancy is lessthan the sample new enqueues threshold, process 650 cancels thegathering of the statistics.

As described above, process 600 describes a process that uses fourdifferent threshold to monitor, gather statistics, and perform otheractions is response to different levels of queue group occupancy of aqueue group. In one embodiment, the network element can use one, some,or all of the four thresholds (queue group occupancy tracking threshold,sample occupants threshold, sample new enqueues threshold, and dropcapture threshold) to characterize the queue group occupancy of thequeue group. For example and in one embodiment, the network element canuse one or more of the thresholds, such as the drop capture threshold,to determine an effect of congestion of a queue group. In thisembodiment, if the queue group occupancy is at a point of congestion,the actions performed in response to the queue group occupancy abovethis level will give an indication of the effect of the congestionand/or alleviate the effect of the congestion. FIG. 7 is a flow diagramof one embodiment of a process 700 that determines an effect ofcongestion. In one embodiment, a network congestion module performsprocess 700 to determine an effect, such as the network congestionmodule 328 of the network element 302 as described in FIG. 3 above. InFIG. 7, process 700 begins by configuring one or more queue groupthresholds that can be used to measure the effect of congestion. In oneembodiment, the thresholds can be one or more of the queue occupancytracking threshold, sample occupants threshold, sample new enqueuesthreshold, and drop capture threshold. In this embodiment, each of thesecan trigger different actions in response to a queue occupancyindicating a congestion of that queue group. For example and in oneembodiment, if congestion is defined as a queue depth at 100%, anadministrator may configure the drop packet threshold for 100% queuedepth, sample new enqueues at 85% queue depth, sample new occupants at80% queue depth, and queue occupancy tracking threshold at 25% queuedepth. In this example, if the queue occupancy reaches at 100% queuedepth, the actions performed in response to the queue depth will give anindication of the effect of the congestion. In addition, actions may beperformed to alleviate this congestion (e.g. dropping stored and/or newenqueue packets, changing the destination port for stored and/or newenqueue packets, etc.).

At block 704, process 700 measures a queue group occupancy of the queuegroup that holds packets to be transmitted. In one embodiment, process700 measures the queue group occupancy by retrieving the queue groupoccupancy value from an ASIC on the data plane of the network element.In this embodiment, the current queue group occupancy is periodicallystored in the ASIC and process 700 retrieves the stored value.

At block 706, process 700 determines if there is congestion for thatqueue group. In one embodiment, process 700 determines if there is queuegroup congestion by determining if the queue group occupancy of thatqueue group is greater than or equal to a threshold that indicatescongestion. In one embodiment, the drop capture threshold can beconfigured to indicate congestion. For example and in one embodiment,the drop capture threshold is configured to be at 100% queue groupoccupancy or below 100% queue group occupancy, where the queue group isin a condition that the queue group cannot (or should not) store anotherpacket (e.g., queue latency is too high). If the queue group occupancydoes not indicate a congestion condition, execution proceeds to block710 below.

If there is congestion for the queue group, process 700 gathersinformation and/or performs other actions for this queue group at block708. In one embodiment, process 700 can perform one or more of manydifferent actions to characterize the stored packets, characterize newenqueue packets, send a notification, and/or alleviate the actualcongestion. Which actions are performed depends on which of thedifferent thresholds are reached and which of the different actions areconfigured to be performed if the thresholds are reached. For exampleand in one embodiment, process 700 performs one or more actions asdescribed above in FIG. 4. Execution proceeds to block 704 above.

At block 710, process 700 determines if information is currently beinggathered (or performing any other action) in response to a previouscongestion effect determination. In one embodiment, process 700determines if actions were setup in response to a previous to the queuegroup occupancy crossing the drop capture threshold (e.g., gatheringstatistics about stored packets, or other actions described above,etc.). If information is currently being gathered (or another actionbeing performed) in response to a previous congestion effectdetermination, at block 712, process cancels this information gathering(and/or any other action being performed in response to a previouscongestion effect determination). In one embodiment, the informationgathering and/or other action is canceled because there is no furthercongestion for that queue group. Execution proceeds block 704 above.

In one embodiment, the network element can use another one or more ofthe thresholds, such as the either sample threshold and/or the queueoccupancy tracking threshold, to determine a causation of the threshold.In this embodiment, if the queue group occupancy approaching a point ofcongestion, the actions performed in response to the queue groupoccupancy above this level will give an indication of a cause of thecongestion. FIG. 8 is a flow diagram of one embodiment of a process 800that determines a cause of congestion. In one embodiment, a networkcongestion module performs process 800 to determine an effect, such asthe network congestion module 328 of the network element 302 asdescribed in FIG. 3 above. In FIG. 8, process 800 begins by configuringa queue group threshold to measure a congestion cause at block 802. Inone embodiment, the thresholds can be one or more of the queue occupancytracking threshold, sample occupants threshold, sample new enqueuesthreshold, and drop capture threshold. In this embodiment, each of thesecan trigger different actions in response to a queue occupancyapproaching a congestion of that queue group. For example and in oneembodiment, if congestion is indicted as a queue depth at 100%, anadministrator may configure the sample new enqueues at 85% queue depth,sample new occupants at 80% queue depth, and queue occupancy trackingthreshold at 25% queue depth. In this example, if the queue occupancyreaches at 80 or 85% queue depth, the actions performed in response tothe queue depth will give an indication of the effect of the congestion.In addition, if the drop capture threshold is set to this level, actionsmay be performed to alleviate this potential congestion (e.g. droppingstored and/or new enqueue packets, changing the destination port forstored and/or new enqueue packets, etc.).

At block 804, process 800 measures a queue group occupancy of the queuegroup that holds the stored packets at block 802. In one embodiment,process 800 measures the queue group occupancy by retrieving the queuegroup occupancy value from an ASIC on the data plane of the networkelement. In this embodiment, the current queue group occupancy isperiodically stored in the ASIC and process 800 retrieves the storedvalue.

At block 804, process 800 determines if there is a potential forcongestion for that queue group. In one embodiment, process 800determines if there is a potential for congestion by determining if thequeue group occupancy of that queue group is greater than or equal to athreshold that indicates a potential for congestion. For example and inone embodiment, the sample occupants and/or sample new enqueuesthreshold can be configured to indicate that there is potentialcongestion in the queue group. In one embodiment, this threshold iscloser to full occupancy (e.g., 80% or greater of one or more of thequeue group occupancy metrics). Once the queue group occupancy hits thisthreshold, if the queue group occupancy continues to increase, the queuegroup and associated port will be congested. Thus, these threshold(s)can serve as a warning that congestion may occur for this queue group.In addition, the network data filling this queue group may be anindication of the potential congestion. If the queue group occupancy isnot greater than the congestion causation threshold, execution proceedsto block 808 below.

If there is a potential for congestion for the queue group, process 800gathers information regarding the stored and/or new enqueue packets atblock 808. In one embodiment, process 800 can perform one or more ofmany different actions to characterize the stored packets, characterizepackets to be stored, and/or alleviate the potential congestion. Whichactions are performed depends on which of the different threshold arereached and which of the different actions are configured to beperformed if the thresholds are reached. For example and in oneembodiment, process 800 performs one or more actions as described abovein FIG. 4. Execution proceeds to block 804 above.

At block 810, process 800 determines if information is currently beinggathered (or performing any other action) in response to a previouscongestion potential determination. In one embodiment, process 800determines if actions were setup in response to a previous to the queuegroup occupancy crossing the congestion causation threshold (e.g.,gathering statistics about stored packets, or other actions describedabove, etc.). If information is currently being gathered (or anotheraction being performed) in response to a previous congestion potentialdetermination, at block 812, process 800 cancels this informationgathering (and/or any other action being performed in response to aprevious congestion effect determination. In one embodiment, theinformation gathering and/or other action is canceled because there isno current potential for congestion for that queue group and the currentqueue occupancy is below one or more of the configured thresholds.Execution proceeds block 804 above.

The processes of FIGS. 7 and 8 can be used to determine a cause andeffect of congestion for a queue group. For example and in oneembodiment, these processes can snapshot the queue group for a periodbefore and after the congestion event (e.g., 30 seconds prior and afterthe congestion event), save to persistent storage (e.g., storage 324 ofFIG. 3 above), and tag this snapshot with the device name and portidentifier of where the congestion even occurred. In one embodiment,this snapshot is subsampled and allows a system administrator to get anindication of the cause and effect of the congestion. In another exampleand embodiment, process 600 can create a real-time micro TransmissionControl Protocol (TCP) dump snapshot that gives a 1:1 packet view intowhat is going into the queue group while the queue group was congested.In one embodiment, the microdump snapshot may be a smaller snapshot thanthe queue group snapshot above, but would allow for greater depth ofinformation.

FIG. 9A is a block diagram of a network congestion module 328 thatmonitors a queue group occupancy to determine a cause and/or effect ofcongestion. In one embodiment, the network congestion module 328includes a queue group measuring module 902, drop capture determinationmodule 904, drop capture action module 906, drop capture cancelationmodule 908, check sample action module 910, queue group occupancytracking determination module 912, queue group occupancy informationmodule 914, and queue group inspection cancelation module 916. In oneembodiment, the queue group measuring module 902 measures the queuegroup occupancy as described in FIG. 6A, block 602 above. The dropcapture determination module 904 determines if the queue group occupancyis greater than or equal to a drop capture threshold as described inFIG. 6A, block 604 above. The drop capture action module 906 performsone or more actions in response to the queue occupancy being equal to orabove the drop capture threshold as described in FIG. 6A, block 606above. The drop capture cancelation module 908 checks for a drop capturethreshold action cancelation as described in FIG. 6A, block 608 above.The check sample action module 910 checks for a sample action asdescribed in FIG. 6A, block 610 above. The queue group occupancytracking determination module 912 determines if the queue groupoccupancy is greater than or equal to queue group occupancy trackingthreshold as described in FIG. 6A, block 612 above. The gather queuegroup occupancy information module 914 gathers queue group occupancyvalues as described in FIG. 6A, block 614 above. The queue groupinspection cancelation module 920 checks for a threshold queue groupoccupancy tracking threshold action cancelation as described in FIG. 6A,block 616 above.

FIG. 9B is a block diagram of a sample check module 910 that checks fora sample threshold action. In one embodiment, the sample check moduleincludes a sample occupants determination module 952, sample occupantsaction module 954, sample occupants cancelation module 956, sample newenqueues determination module 958, sample new enqueues action module960, and sample new enqueue cancelation module 962. In one embodiment,the sample occupants determination module 952 determines if the queueoccupancy is at or above the sample occupants threshold as described inFIG. 6B at block 652 above. The sample occupants action module 954performs one or more actions as described in FIG. 6B at block 654 above.The sample occupants cancelation module 956 checks for a sampleoccupants action cancelation as described in FIG. 6B at block 656 above.The sample new enqueues determination module 958 determines if the queueoccupancy of at or greater than the sample new enqueues threshold asdescribed in FIG. 6B at block 658 above. The sample new enqueues actionmodule 960 performs one or more actions as described in FIG. 6B at block660 above. The sample new enqueue cancelation module 962 checks for asample new enqueues action cancelation as described in FIG. 6B at block662 above.

FIG. 10 is a block diagram of a network congestion module 328 thatmonitors a queue group occupancy of a port queue group and performs anaction if the drop capture threshold is reached. In one embodiment, thenetwork congestion module 328 includes a configure threshold module1002, queue group occupancy measurement module 1004, congestiondetermination module 1006, gather congestion information module 1008,congestion information cancelation check module 1010, and congestioninformation cancelation module 1012. In one embodiment, the configurethreshold module 1002 configures the threshold as described in FIG. 7,block 702 above. The queue group occupancy measurement module 1004measures the queue group occupancy as described in FIG. 7, block 704above. The congestion determination module 1006 determines if there iscongestion for a queue group as described in FIG. 7, block 706 above.The gather congestion information module 1006 gathers the congestioneffect information (and/or perform other actions) as described in FIG.7, block 708 above. The congestion information cancelation check module1010 checks for a drop capture threshold action cancelation as describedin FIG. 7, block 7010 above. The congestion information cancelationmodule 1010 cancels the congestion information gathering as described inFIG. 7, block 712 above.

FIG. 11 is a block diagram of a network congestion module 328 thatmonitors a queue group occupancy of a port queue group and performs anaction if one of the congestion causation thresholds is reached. In oneembodiment, the network congestion module 328 includes a configurethreshold module 1102, queue group occupancy measurement module 1104,congestion determination module 1106, gather congestion informationmodule 1108, congestion information cancelation check module 1110, andcongestion information cancelation module 1112. In one embodiment, theconfigure threshold module 1102 configures the threshold as described inFIG. 8, block 802 above. The queue group occupancy measurement module1104 measures the queue group occupancy as described in FIG. 8, block804 above. The congestion causation determination module 1106 determinesif there is a potential for congestion of a queue group as described inFIG. 8, block 806 above. The gather congestion causation informationmodule 1108 gathers the congestion causation information (and/or performother actions) as described in FIG. 8, block 808 above. The congestioncausation information cancelation check module 1110 checks for acongestion causation threshold action cancelation as described in FIG.8, block 810 above. The congestion causation information cancelationmodule 1112 cancels the congestion causation information gathering asdescribed in FIG. 8, block 812 above.

FIG. 12 shows one example of a data processing system 1200, which may beused with one embodiment of the present invention. For example, thesystem 1200 may be implemented including a network element 302 as shownin FIG. 3. Note that while FIG. 12 illustrates various components of acomputer system, it is not intended to represent any particulararchitecture or manner of interconnecting the components as such detailsare not germane to the present invention. It will also be appreciatedthat network computers and other data processing systems or otherconsumer electronic devices, which have fewer components or perhaps morecomponents, may also be used with the present invention.

As shown in FIG. 12, the computer system 1200, which is a form of a dataprocessing system, includes a bus 1203 which is coupled to amicroprocessor(s) 1205 and a ROM (Read Only Memory) 1207 and volatileRAM 1209 and a non-volatile memory 1211. The microprocessor 1205 mayretrieve the instructions from the memories 1207, 1209, 1211 and executethe instructions to perform operations described above. The bus 1203interconnects these various components together and also interconnectsthese components 1205, 1207, 1209, and 1211 to a display controller anddisplay device 1215 and to peripheral devices such as input/output (I/O)devices which may be mice, keyboards, modems, network interfaces,printers and other devices which are well known in the art. Typically,the input/output devices 1215 are coupled to the system throughinput/output controllers 1217. The volatile RAM (Random Access Memory)1209 is typically implemented as dynamic RAM (DRAM), which requirespower continually in order to refresh or maintain the data in thememory.

The mass storage 1211 is typically a magnetic hard drive or a magneticoptical drive or an optical drive or a DVD RAM or a flash memory orother types of memory systems, which maintain data (e.g. large amountsof data) even after power is removed from the system. Typically, themass storage 1211 will also be a random access memory although this isnot required. While FIG. 12 shows that the mass storage 1211 is a localdevice coupled directly to the rest of the components in the dataprocessing system, it will be appreciated that the present invention mayutilize a non-volatile memory which is remote from the system, such as anetwork storage device which is coupled to the data processing systemthrough a network interface such as a modem, an Ethernet interface or awireless network. The bus 1203 may include one or more buses connectedto each other through various bridges, controllers and/or adapters as iswell known in the art.

Portions of what was described above may be implemented with logiccircuitry such as a dedicated logic circuit or with a microcontroller orother form of processing core that executes program code instructions.Thus processes taught by the discussion above may be performed withprogram code such as machine-executable instructions that cause amachine that executes these instructions to perform certain functions.In this context, a “machine” may be a machine that converts intermediateform (or “abstract”) instructions into processor specific instructions(e.g., an abstract execution environment such as a “process virtualmachine” (e.g., a Java Virtual Machine), an interpreter, a CommonLanguage Runtime, a high-level language virtual machine, etc.), and/or,electronic circuitry disposed on a semiconductor chip (e.g., “logiccircuitry” implemented with transistors) designed to executeinstructions such as a general-purpose processor and/or aspecial-purpose processor. Processes taught by the discussion above mayalso be performed by (in the alternative to a machine or in combinationwith a machine) electronic circuitry designed to perform the processes(or a portion thereof) without the execution of program code.

The present invention also relates to an apparatus for performing theoperations described herein. This apparatus may be specially constructedfor the required purpose, or it may comprise a general-purpose computerselectively activated or reconfigured by a computer program stored inthe computer. Such a computer program may be stored in a computerreadable storage medium, such as, but is not limited to, any type ofdisk including floppy disks, optical disks, CD-ROMs, andmagnetic-optical disks, read-only memories (ROMs), RAMs, EPROMs,EEPROMs, magnetic or optical cards, or any type of media suitable forstoring electronic instructions, and each coupled to a computer systembus.

A machine readable medium includes any mechanism for storing ortransmitting information in a form readable by a machine (e.g., acomputer). For example, a machine readable medium includes read onlymemory (“ROM”); random access memory (“RAM”); magnetic disk storagemedia; optical storage media; flash memory devices; etc.

An article of manufacture may be used to store program code. An articleof manufacture that stores program code may be embodied as, but is notlimited to, one or more memories (e.g., one or more flash memories,random access memories (static, dynamic or other)), optical disks,CD-ROMs, DVD ROMs, EPROMs, EEPROMs, magnetic or optical cards or othertype of machine-readable media suitable for storing electronicinstructions. Program code may also be downloaded from a remote computer(e.g., a server) to a requesting computer (e.g., a client) by way ofdata signals embodied in a propagation medium (e.g., via a communicationlink (e.g., a network connection)).

FIG. 13 is a block diagram of one embodiment of an exemplary networkelement 1300 that that determines a cause and effect of congestion inthis network element according to one embodiment of the system. In FIG.13, the backplane 1306 couples to the line cards 1302A-N and controllercards 1304A-B. While in one embodiment, the controller cards 1304A-Bcontrol the processing of the traffic by the line cards 1302A-N, inalternate embodiments, the controller cards 1304A-B, perform the sameand/or different functions (storing information for determining a causeand effect of congestion, etc.). In one embodiment, the line cards1302A-N process and forward traffic according to the network policiesreceived from controller cards the 1304A-B. In one embodiment, one ofthe line cards 1302A-N monitors queue group occupancies of queue groupsand collect information to determine a cause and effect of congestion inthe queue group as described in FIGS. 3, 4, and 6-8. In this embodiment,one, some, or all of the line cards 1302A-N includes the networkcongestion module to determine a cause and effect of congestion in thisnetwork element 1300, such as the network congestion module 328 asdescribed in FIG. 3 above. In another embodiment, the controller cards1304A-N determines a cause and effect of congestion for each port thatexhibits congestion of the respective line card 1304A-N as described inFIGS. 3 and 6-8. It should be understood that the architecture of thenetwork element 1300 illustrated in FIG. 13 is exemplary, and differentcombinations of cards may be used in other embodiments of the invention.

The preceding detailed descriptions are presented in terms of algorithmsand symbolic representations of operations on data bits within acomputer memory. These algorithmic descriptions and representations arethe tools used by those skilled in the data processing arts to mosteffectively convey the substance of their work to others skilled in theart. An algorithm is here, and generally, conceived to be aself-consistent sequence of operations leading to a desired result. Theoperations are those requiring physical manipulations of physicalquantities. Usually, though not necessarily, these quantities take theform of electrical or magnetic signals capable of being stored,transferred, combined, compared, and otherwise manipulated. It hasproven convenient at times, principally for reasons of common usage, torefer to these signals as bits, values, elements, symbols, characters,terms, numbers, or the like.

It should be kept in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. Unlessspecifically stated otherwise as apparent from the above discussion, itis appreciated that throughout the description, discussions utilizingterms such as “measuring,” “receiving,” “determining,” “transmitting,”“sending,” “forwarding,” “detecting,” “gathering,” “dropping,”“communicating,” “canceling,” or the like, refer to the action andprocesses of a computer system, or similar electronic computing device,that manipulates and transforms data represented as physical(electronic) quantities within the computer system's registers andmemories into other data similarly represented as physical quantitieswithin the computer system memories or registers or other suchinformation storage, transmission or display devices.

The processes and displays presented herein are not inherently relatedto any particular computer or other apparatus. Various general-purposesystems may be used with programs in accordance with the teachingsherein, or it may prove convenient to construct a more specializedapparatus to perform the operations described. The required structurefor a variety of these systems will be evident from the descriptionbelow. In addition, the present invention is not described withreference to any particular programming language. It will be appreciatedthat a variety of programming languages may be used to implement theteachings of the invention as described herein.

The foregoing discussion merely describes some exemplary embodiments ofthe present invention. One skilled in the art will readily recognizefrom such discussion, the accompanying drawings and the claims thatvarious modifications can be made without departing from the spirit andscope of the invention.

What is claimed is:
 1. A non-transitory machine-readable medium havingexecutable instructions to cause one or more processing units to performa method to determine a cause of congestion in a network element, themethod comprising: configuring a queue group corresponding to a port ofthe network element with a sample new enqueue threshold and a sampleoccupants threshold, wherein the sample new enqueue threshold is athreshold when new enqueue packets are sampled for characteristics of asubset of the new enqueue packets to be enqueued to that queue group,the sample occupants threshold is a threshold when a subset of aplurality of packets stored in the queue group are sampled forcharacteristics, and the sample new enqueue and sample occupantsthresholds are different; measuring a queue group occupancy of the queuegroup for a port in the network element, wherein the queue group storesthe plurality of packets to be communicated through that port; gatheringinformation of the subset of new enqueue packets for that queue groupwhen the queue group occupancy measurement is above the sample newenqueue threshold; gathering information of the subset of the pluralityof packets for that queue group when the queue group occupancymeasurement is above the sample occupants threshold; and transmitting atleast one of the plurality of packets in the queue group when the queuegroup occupancy measurement is below a lower of the sample occupantsthreshold and sample new enqueue threshold.
 2. The non-transitorymachine-readable medium of claim 1, wherein the gathered information ofthe subset of the plurality of packets is used to determine a cause ofthe potential congestion.
 3. The non-transitory machine-readable mediumof claim 1, wherein the queue group is selected from the groupconsisting of a single queue, multiple queues, a class of queues, andmultiple classes of queues.
 4. The non-transitory machine-readablemedium of claim 1, wherein the gathering information of the subset ofnew enqueue packets comprises: transmitting new enqueue packets outanother port.
 5. The non-transitory machine-readable medium of claim 4,wherein the gathering information of the subset of new enqueue packetscomprises: sending the subset of the new enqueue packets to the controlplane, wherein the subset of enqueue packets is stored for latercongestion effect analysis.
 6. The non-transitory machine-readablemedium of claim 1, further comprising: dropping at least some of theplurality of packets.
 7. A non-transitory machine-readable medium havingexecutable instructions to cause one or more processing units to performa method to determine a cause of congestion in a network element, themethod comprising: configuring a queue group corresponding to a port ofthe network element with a sample occupants threshold and a dropthreshold, wherein the sample occupants threshold is a threshold when asubset of a plurality of packets stored in the queue group are sampledfor characteristics, the drop packet threshold is a threshold whenpackets are dropped, and the sample occupants threshold is less than thedrop threshold; measuring a queue group occupancy of the queue group fora port in the network element, wherein the queue group stores theplurality of packets to be communicated through that port; gatheringinformation of the subset of the plurality of packets for that queuegroup when the queue group occupancy measurement is above the sampleoccupants threshold; and transmitting at least one of the plurality ofpackets in the queue group when the queue group occupancy measurement isbelow the sample occupants threshold.
 8. The non-transitorymachine-readable medium of claim 1, wherein the gathered information ofthe subset of the plurality of packets is used to determine a cause ofthe potential congestion.
 9. The non-transitory machine-readable mediumof claim 1, wherein the queue group is selected from the groupconsisting of a single queue, multiple queues, a class of queues, andmultiple classes of queues.
 10. A non-transitory machine-readable mediumhaving executable instructions to cause one or more processing units toperform a method to characterize a queue group in a network element, themethod comprising: configuring the queue group corresponding to a portof the network element with a record occupancy threshold and a dropthreshold, wherein the drop packet threshold is a threshold when packetsare dropped and the record occupancy threshold is less than the dropthreshold; measuring a queue group occupancy of the queue group for aport in the network element, wherein the queue group stores a pluralityof packets to be communicated through that port; recording the queuegroup occupancy if the queue group occupancy is greater than a recordoccupancy threshold, wherein the queue group occupancy recording isturned off if the queue group occupancy is below the record occupancythreshold and the recording stores a plurality of queue group occupancyvalues from the queue group occupancy recording; and transmitting atleast one of the plurality of packets in the queue group when the queuegroup occupancy measurement is below the drop threshold.
 11. Thenon-transitory machine-readable medium of claim 10, wherein the queuegroup is selected from the group consisting of a single queue, multiplequeues, a class of queues, and multiple classes of queues.
 12. A methodto determine a cause of congestion in a network element, the methodcomprising: configuring a queue group corresponding to a port of thenetwork element with a sample new enqueue threshold and a sampleoccupants threshold, wherein the sample new enqueue threshold is athreshold when new enqueue packets are sampled for characteristics of asubset of the new enqueue packets to be enqueued to that queue group,the sample occupants threshold is a threshold when a subset of aplurality of packets stored in the queue group are sampled forcharacteristics, and the sample new enqueue and sample occupantsthresholds are different; measuring a queue group occupancy of the queuegroup for a port in the network element, wherein the queue group storesthe plurality of packets to be communicated through that port; gatheringinformation of the subset of new enqueue packets for that queue groupwhen the queue group occupancy measurement is above the sample newenqueue threshold; gathering information of the subset of the pluralityof packets for that queue group when the queue group occupancymeasurement is above the sample occupants threshold; and transmitting atleast one of the plurality of packets in the queue group when the queuegroup occupancy measurement is below a lower of the sample occupantsthreshold and sample new enqueue threshold.
 13. The method of claim 12,wherein the queue group is selected from the group consisting of asingle queue, multiple queues, a class of queues, and multiple classesof queues.
 14. The method of claim 12, wherein the gathering informationof the subset of new enqueue packets comprises: transmitting new enqueuepackets out another port.
 15. The method of claim 14, wherein thegathering information of the subset of new enqueue packets comprises:sending the subset of the new enqueue packets to the control plane,wherein the subset of enqueue packets is stored for later congestioneffect analysis.
 16. A method to determine a cause of congestion in anetwork element, the method comprising: configuring a queue groupcorresponding to a port of the network element with a sample occupantsthreshold and a drop threshold, wherein the sample occupants thresholdis a threshold when a subset of a plurality of packets stored in thequeue group are sampled for characteristics, the drop packet thresholdis a threshold when packets are dropped, and the sample occupantsthreshold is less than the drop threshold; measuring a queue groupoccupancy of the queue group for a port in the network element, whereinthe queue group stores the plurality of packets to be communicatedthrough that port; gathering information of the subset of the pluralityof packets for that queue group when the queue group occupancymeasurement is above the sample occupants threshold; and transmitting atleast one of the plurality of packets in the queue group when the queuegroup occupancy measurement is below the sample occupants threshold. 17.The method of claim 16, wherein the gathered information of the subsetof the plurality of packets is used to determine a cause of thepotential congestion.
 18. The method of claim 16, wherein the queuegroup is selected from the group consisting of a single queue, multiplequeues, a class of queues, and multiple classes of queues.
 19. A methodto characterize a queue group in a network element, the methodcomprising: configuring the queue group corresponding to a port of thenetwork element with a record occupancy threshold and a drop threshold,wherein the drop packet threshold is a threshold when packets aredropped and the record occupancy threshold is less than the dropthreshold; measuring a queue group occupancy of the queue group for aport in the network element, wherein the queue group stores a pluralityof packets to be communicated through that port; recording the queuegroup occupancy if the queue group occupancy is greater than a recordoccupancy threshold, wherein the queue group occupancy recording isturned off if the queue group occupancy is below the record occupancythreshold and the recording stores a plurality of queue group occupancyvalues from the queue group occupancy recording; and transmitting atleast one of the plurality of packets in the queue group when the queuegroup occupancy measurement is below the drop threshold.
 20. A networkelement to determine a cause of congestion in a network element, thenetwork element comprising: a port to be coupled to the network, theport to communicate a plurality of packets between the network andnetwork element; and a data plane to be coupled to the port, the dataplane including, a queue group, coupled to the port, the queue group tostore the plurality of packets; and a network congestion module, coupledto the queue group, the network congestion module to configure a queuegroup corresponding to a port of the network element with a sample newenqueue threshold and a sample occupants threshold, wherein the samplenew enqueue threshold is a threshold when new enqueue packets aresampled for characteristics of a subset of the new enqueue packets to beenqueued to that queue group, the sample occupants threshold is athreshold when a subset of a plurality of packets stored in the queuegroup are sampled for characteristics, and the sample new enqueue andsample occupants thresholds are different, measure a queue groupoccupancy of the queue group for a port in the network element, whereinthe queue group stores the plurality of packets to be communicatedthrough that port, gather information of the subset of new enqueuepackets for that queue group when the queue group occupancy measurementis above the sample new enqueue threshold, gather information of thesubset of the plurality of packets for that queue group when the queuegroup occupancy measurement is above the sample occupants threshold, andtransmit at least one of the plurality of packets in the queue groupwhen the queue group occupancy measurement is below a lower of thesample occupants threshold and sample new enqueue threshold.